<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="format-detection" content="telephone=no" />
    <meta name="format-detection" content="email=no" />
    <title>仓储物流</title>
    <link rel="stylesheet" href="../../css/api.css">
    <link rel="stylesheet" href="../../css/vant.css">
    <link rel="stylesheet" href="../../css/swiper.min.css">
    <link rel="stylesheet" href="../../css/main.css">
    <style>
        .van-tabs__line {
            width: .22rem !important;
        }
    </style>
</head>

<body>
    <div class="app" v-cloak>
        <div class="header-common">
            <div class="flex-x-s header">
                <span class="iconfont goback" @click="back">&#xe66f;</span>
                <div class="search flex-x-s" @click="goPage">
                    <span class="iconfont">&#xe71e;</span>
                    <input type="text" maxlength="20" placeholder="请搜索关键词" readonly>
                </div>
                <div class="search-btn" @click="goPage">搜索</div>
            </div>
            <!-- <van-tabs v-model="active" color="#3F8CEC" title-active-color="#3F8CEC" line-height="1px"
                @click="setFrameGroupIndex">
                <van-tab title="物流运输"></van-tab>
                <van-tab title="货找车"></van-tab>
            </van-tabs> -->
            <div class="screen-nav flex-x-sa flex-wrap">
                <div class="screen-item flex-x-s" v-for="(item,index) in wxList" :key="index" @click="select(index)">
                    <div>{{item}}</div>
                    <span class="iconfont">&#xe665;</span>
                </div>
            </div>
        </div>
    </div>
    <script src="../../script/api.js"></script>
    <script src="../../script/flexible.js"></script>
    <script src="../../script/fastclick.js"></script>
    <script src="../../script/vue.min.js"></script>
    <script src="../../script/iconfont.js"></script>
    <script src="../../script/vant.min.js"></script>
    <script src="../../script/swiper.min.js"></script>
    <script src="../../script/common.js"></script>
    <script>
        apiready = function () {
            vm = new Vue({
                el: '.app',
                data: {
                    headerH: 0,
                    footerH: 0,
                    frames: [{
                        name: 'logistics_frm_win',
                        url: './logistics_frm.html',
                    }
                    // , {
                    //     name: 'warehouse_frm',
                    //     url: './warehouse_frm.html',
                    // }
                ],
                    active: 0,
                    wxList: [],
                },
                mounted() {
                    var header = $api.dom('.header-common');
                    this.headerH = $api.fixStatusBar(header);
                    console.log(this.headerH)
                    this.openFrameGroup();
                    setBDPageStart("仓储物流")
                },
                methods: {
                    goPage() {
                        var title = "";
                        if (this.active == 0) {
                            title = "WULIU"
                        } else if (this.active == 1) {
                            title = "STORAGE"
                        }
                        api.openWin({
                            name: 'search_win',
                            url: '../search/search_win.html',
                            bounces: false,
                            pageParam: {
                                isHistory: false,
                                title: title,
                                titlePlus: '仓储物流'
                            }
                        });
                    },
                    back() {
                        setBDPageEnd("仓储物流")
                        api.closeWin();
                    },
                    openFrameGroup() {
                        var vm = this;
                        api.openFrameGroup({
                            name: 'warehouse_logistics_group',
                            rect: {
                                marginTop: vm.headerH + 59,
                                marginBottom: 0,
                                w: 'auto'
                            },
                            scrollEnabled: true,
                            frames: vm.frames,
                            preload: 0
                        }, function (ret, err) {
                            vm.active = ret.index;
                            if (vm.active == 0) {
                                vm.wxList = ['出发地', '目的地', '类型', '货物类型', '更多']
                            } else {
                                vm.wxList = ['地区', '面积', '类型']
                            }
                        });
                    },
                    setFrameGroupIndex() {
                        api.setFrameGroupIndex({
                            name: 'warehouse_logistics_group',
                            scroll: true,
                            index: this.active
                        });
                    },
                    select(index) {
                        api.sendEvent({
                            name: 'showFilterBox',
                            extra: {
                                index: index,
                                active: this.active
                            }
                        });
                    }
                },
            })

            api.addEventListener({
                name: 'keyback'
            }, function (ret, err) {
                setBDPageEnd("仓储物流")
                api.closeWin();
            });
        }
    </script>
</body>

</html>